def encrypt(string,cipherKey): |
return ciphertext |
newchar = cipherKey[char] |
if char in cipherKey: |
for x in range(len(string)): |
ciphertext += newchar |
else: |
ciphertext = "" |
ciphertext += char |
char = string[x] |
def encrypt(string,cipherKey): |
    return ciphertext |
            newchar = cipherKey[char] |
        if char in cipherKey: |
    for x in range(len(string)): |
            ciphertext += newchar |
        else: |
    ciphertext = "" |
            ciphertext += char |
        char = string[x] |
1 | def encrypt(string,cipherKey): |
2 |     ciphertext = "" |
3 |     for x in range(len(string)): |
4 |         char = string[x] |
5 |         if char in cipherKey: |
6 |             newchar = cipherKey[char] |
7 |             ciphertext += newchar |
8 |         else: |
9 |             ciphertext += char |
10 |     return ciphertext |
reverseSub = {} |
for key in substitution: |
reverseSub[value] = key |
encrypt(cipherText,reverseSub) |
value = substitution[key] |
reverseSub = {} |
for key in substitution: |
    reverseSub[value] = key |
encrypt(cipherText,reverseSub) |
    value = substitution[key] |
1 | reverseSub = {} |
2 | for key in substitution: |
3 |     value = substitution[key] |
4 |     reverseSub[value] = key |
5 | encrypt(cipherText,reverseSub) |
i = alphabet.index(char) |
ciphertext += alphabet[i] |
for x in range(len(plaintext)): |
if i >= len(alphabet): |
ciphertext += char |
return ciphertext |
else: |
ciphertext = "" |
i = i - len(alphabet) |
def ceasarCipher(plaintext,key): |
if char not in alphabet: |
i += key |
char = plaintext[x] |
            i = alphabet.index(char) |
            ciphertext += alphabet[i] |
    for x in range(len(plaintext)): |
            if i >= len(alphabet): |
            ciphertext += char |
    return ciphertext |
        else: |
    ciphertext = "" |
                i = i - len(alphabet) |
def ceasarCipher(plaintext,key): |
        if char not in alphabet: |
            i += key |
        char = plaintext[x] |
1 | def ceasarCipher(plaintext,key): |
2 |     ciphertext = "" |
3 |     for x in range(len(plaintext)): |
4 |         char = plaintext[x] |
5 |         if char not in alphabet: |
6 |             ciphertext += char |
7 |         else: |
8 |             i = alphabet.index(char) |
9 |             i += key |
10 |             if i >= len(alphabet): |
11 |                 i = i - len(alphabet) |
12 |             ciphertext += alphabet[i] |
13 |     return ciphertext |
cipher_char = chr(newInt) |
plainInt = ord(plaintext[i]) |
def vernam_cipher(plaintext, key): |
newInt = plainInt ^ cipherInt |
cipher_text += cipher_char |
return "False" |
cipherInt = ord(key[i]) |
for i in range(len(plaintext)): |
cipher_text = "" |
return cipher_text |
if len(plaintext) != len(key): |
        cipher_char = chr(newInt) |
        plainInt = ord(plaintext[i]) |
def vernam_cipher(plaintext, key): |
        newInt = plainInt ^ cipherInt |
        cipher_text += cipher_char |
        return "False" |
        cipherInt = ord(key[i]) |
    for i in range(len(plaintext)): |
    cipher_text = "" |
    return cipher_text |
    if len(plaintext) != len(key): |
1 | def vernam_cipher(plaintext, key): |
2 |     if len(plaintext) != len(key): |
3 |         return "False" |
4 | |
5 |     cipher_text = "" |
6 |     for i in range(len(plaintext)): |
7 |         plainInt = ord(plaintext[i]) |
8 |         cipherInt = ord(key[i]) |
9 |         newInt = plainInt ^ cipherInt |
10 |         cipher_char = chr(newInt) |
11 |         cipher_text += cipher_char |
12 |      |
13 |     return cipher_text |
current_time = int(time.time() * 1000) |
def simple_random_number(min_val=0, max_val=100): |
import time |
return random_num |
random_num = current_time % (max_val - min_val + 1) + min_val |
    current_time = int(time.time() * 1000) |
def simple_random_number(min_val=0, max_val=100): |
import time |
    return random_num |
    random_num = current_time % (max_val - min_val + 1) + min_val |
1 | import time |
2 | |
3 | def simple_random_number(min_val=0, max_val=100): |
4 |     current_time = int(time.time() * 1000) |
5 |      |
6 |     random_num = current_time % (max_val - min_val + 1) + min_val |
7 |     return random_num |